package struts.control;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import struts.bean.BaseBean;
import struts.bean.LoginBean;

public class LoginAction implements BaseAction{
	

	@Override
	public String execute(HttpServletRequest request, HttpServletResponse response,BaseBean form) {
		System.out.println("UserAction--"+form.toString());
		String result="fail";
		LoginBean user=(LoginBean)form;
		if("xyz".equals(user.getUsername())){
			result="success";
		}
		request.setAttribute("user", user.getUsername());
		return result;
	}
}
